package com.rui.study.commons.study.support.configuration;

import com.rui.study.commons.study.support.factory.SimpleThreadFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ScheduledThreadPoolExecutor;

@Configuration
public class SimpleScheduledThreadPoolExecutorConfiguration {

    @Bean
    public ScheduledThreadPoolExecutor scheduledThreadPoolExecutor() {
        return new ScheduledThreadPoolExecutor(4, new SimpleThreadFactory("my-scheduled"));
    }
}
